<?php
/**
 * Created by PhpStorm.
 * User: wudiying
 * Date: 2018/11/19
 * Time: 下午10:28
 */

namespace IMooc;

class  Object{// 类名和文件名要绝对一致

    protected $array = [];

    static function methodName(){
        echo __METHOD__;
    }

    function __set($name, $value)
    {
        $this->array[$name] = $value;
    }

    function __get($name)
    {
        return $this->array[$name];
    }

    function __call($name, $arguments)
    {
        var_dump($name,$arguments);
        echo '__call';
    }

    static function __callStatic($name, $arguments)
    {
        var_dump($name,$arguments);
        echo '__callStatic';
    }

    function __toString()
    {
        return __CLASS__;
    }

    public function __invoke($arguments)
    {
        var_dump($arguments);
        echo '__invoke';
    }
}